package com.starleague.trait;

import com.starleague.entity.AbstractEntity;
import com.starleague.entity.IEntityVisitor;

public abstract class AbstractTrait
        extends AbstractEntity
        implements ITrait
{
    private String traitId;
    private String traitName;

    protected AbstractTrait(String traitId,
                            String traitName)
    {
        this.traitId = traitId;
        this.traitName = traitName;
    }

    protected AbstractTrait()
    {
        // For serialization
    }

    @Override
    public String getTraitId()
    {
        return this.traitId;
    }

    protected void setTraitId(String traitId)
    {
        this.traitId = traitId;
    }

    @Override
    public String getTraitName()
    {
        return this.traitName;
    }

    protected void setTraitName(String traitName)
    {
        this.traitName = traitName;
    }

    @Override
    public void accept(IEntityVisitor visitor)
    {
        super.accept(visitor);
        visitor.visit(TRAIT_ID, this.traitId);
        visitor.visit(TRAIT_NAME, this.traitName);
    }
}
